
/**
 * @file servo.c
 * @author      JinChengLong (https://gitee.com/Datejin/)
 * @brief       舵机库函数
 * @version     0.1
 * @date        2023
 * 
 * @copyright   Copyright © 2025 by JinChengLong 
 * 
 * All rights reserved.
 * Unauthorized copying, reproduction, or redistribution of this file via any medium is strictly prohibited.  
 * Proprietary and confidential.
 *   
 */


#include "servo.h"


/**
 * @brief 设置电机的位置
 * 
 * @param angle 
 */
void servo_angle(float angle)
{
	pwm_init();
	TIM_SetCompare3(TIM2,angle/180*2000+500);			//是设置CCR寄存器的值不直接是占空比，由公式得到的

}	





